@extends('layout.layout')
@section('title','名家讲堂')
@section('content')


<div class="main">
    <div class="online">
        <div class="online_class">
            <div class="online_class_bg"><img src="/res/images/last_time_bg.jpg" /></div>
            <div class="online_class_body">
                <div class="before">
                    <div class="last_time_big">
                        <span class="time1">--</span>
                        <span class="time2">--</span>
                        <span class="time3">--</span>
                        <span class="time4">--</span>
                    </div>
                    <a class="class_href" href="#"></a>
                </div>
                <!--会议结束-->
                <div class="end_title" style="display:none">会议已结束</div>
                <!--会议进行中-->
                <div class="meeting" style="display:none">
                    <a href="#">
                        <img src="/res/images/online_classing.png" />
                    </a>
                </div>
                <div class="online_export_box">
                    <div class="online_export_bg"></div>
                    @foreach ($currentVideo->experts->take(1) as $expert)
                        <div class="online_export clearfix">
                        <div class="online_export_ship">
                            <div class="online_export_img">


                                <a href="#"><img src={{$expert->thumb}} /></a>
                            </div>
                            <div class="online_export_txt">
                                <p>专家：{{$expert->name}}</p>
                                <p>医院：{{$expert->hospital}}</p>
                                <p>科室：{{$expert->department}}</p>
                                <p>职称：{{$expert->chenghao}}</p>
                            </div>
                        </div>

                        <!--课程简介-->
                        <div class="online_export_ship border_left">
                            <div class="online_export_intro">
                                <p><b>课程简介</b></p>
                                <p>{{$expert->introduction}}</p>
                            </div>@endforeach
                        </div>
                    </div>

                </div>
            </div>
        </div>
        <div class="online_class_share">
            <span>分享到：</span>
            <a href="#" onclick="err()"><img src="/res/images/icon_weixin.jpg" /></a>
        </div>
    </div>
</div>
<div class="shadow" style="display:none"></div>
<div class="chat_pop" style="display:none">
    <div class="chat_pop_top"><a href="#" onclick="Pop_close1()" class="chat_pop_close"></a></div>
    <div class="chat_pop_body">
        <img src="/res/images/11.png">
        <p>使用微信扫一扫，并将网页分享给好友</p>
    </div>
</div>
<script>
    function err(){
        let one=$('.shadow');
        let two=$('.chat_pop');
        one.css('display','');
        two.css('display','');
    }
    function Pop_close1(){
        // alert(1);
        let one1=$('.shadow');
        let two1=$('.chat_pop');
        one1.css('display','none');
        two1.css('display','none');
    }

</script>
<script>
    // 确定倒计时截止时间为最近一次开播时间
    var endTime = new Date('{{ $latestStartTime }}');

    // 更新倒计时显示数据
    function updateCountdown() {
        var now = new Date();
        var timeLeft = endTime - now;

        // 计算剩余的天、小时、分钟和秒数
        var days = Math.floor(timeLeft / (1000 * 60 * 60 * 24));
        var hours = Math.floor((timeLeft % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
        var minutes = Math.floor((timeLeft % (1000 * 60 * 60)) / (1000 * 60));
        var seconds = Math.floor((timeLeft % (1000 * 60)) / 1000);

        // 获取页面元素
        var time1 = document.querySelector('.time1');
        var time2 = document.querySelector('.time2');
        var time3 = document.querySelector('.time3');
        var time4 = document.querySelector('.time4');

        // 更新页面元素内容
        time1.innerHTML = days;
        time2.innerHTML = hours < 10 ? '0' + hours : hours;
        time3.innerHTML = minutes < 10 ? '0' + minutes : minutes;
        time4.innerHTML = seconds < 10 ? '0' + seconds : seconds;
    }

    // 每秒钟更新一次倒计时数据
    setInterval(updateCountdown, 1000);
</script>
@endsection
